package info.jimao.newsdk.callbacks;


import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.zhy.http.okhttp.callback.Callback;

import info.jimao.newsdk.models.CreateOrder;
import okhttp3.Call;
import okhttp3.Response;

public abstract class CreateOrderCallback extends Callback<CreateOrder> {
    @Override
    public CreateOrder parseNetworkResponse(Response response) throws Exception {
        String responseString = response.body().string();
        Gson gson = new GsonBuilder().create();
        return gson.fromJson(responseString, CreateOrder.class);
    }

    @Override
    public void onError(Call call, Exception e) {

    }

    @Override
    public void onResponse(CreateOrder response) {

    }
}
